package com.glm.fruit.entity;

import lombok.Data;

@Data
public class CartItem {
    private Fruit fruit;
    private int weight;
    public double getSubtotal() {
        return fruit.getPricePerJin() * weight;
    }

    public CartItem(Fruit fruit, int weight) {
        this.fruit = fruit;
        this.weight = weight;
    }
}
